<template>
	<view class="wrap">

		<u-row class="p20">
			<u-col span="2" style="display: flex;,justify-content: center;align-items: center;">
				<u-avatar :src="src" size="50"></u-avatar>
			</u-col>
			<u-col span="5">
				<text class="flexCC"> {{name}}</text>
			</u-col>
			<u-col span="5">
				<text class="flexCC"></text>
			</u-col>
		</u-row>

		<u-cell-group class="bg_white m10 border_radius_shadow">
			<u-cell icon="order" title="工号" :arrow="false" :value="data.ryid"></u-cell>
			<u-cell icon="account" title="姓名" :arrow="false" :value="data.ryxm" @click="btnToPage()"></u-cell>
			<u-cell icon="phone" title="联系方式" :arrow="false" :value="data.phone"></u-cell>
			<u-cell icon="man-add" title="单位" :arrow="false" :value="data.dwmc"></u-cell>
			<u-cell icon="man-add" title="部门" :arrow="false" :value="data.bmmc"></u-cell>
		</u-cell-group>

		<view class="mt30 ml10 mr10" v-if="isShow">
			<u-button color="#007aff" @click="btnLogout">退出登录</u-button>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				data: {},
				src: '/static/img/tx.png',
				isShow: false,
				name: ""
			}
		},
		onShow() {

			this.$api.myAjaxFunc(Config.PlatformAPI + publicJs.Config.IndexUrl.GetInfo, {}, {
				loading: false
			}).then((res) => {
				this.data = res;
				this.name = '[' + res.ryid + ']' + ' ' + res.ryxm;
			})

			if (process.env.NODE_ENV == "development") {
				this.isShow = true
			}

		},
		methods: {
			btnLogout() {

				uni.removeStorageSync('token');
				uni.navigateTo({
					url: '/pages/Login'
				});

			}
		}
	}
</script>

<style scoped lang="scss">

</style>
